package com.danbay.cloud.deviceaccess.api.service;

import com.danbay.cloud.deviceaccess.api.dto.DeviceLogin;
import com.danbay.cloud.deviceaccess.api.dto.DeviceLogout;
import com.danbay.cloud.deviceaccess.api.dto.DeviceReg;
import com.danbay.cloud.deviceaccess.api.dto.DeviceRegResult;
import com.danbay.framework.exception.BusinessException;
import com.danbay.framework.springnc.annotation.RequestMapping;
import com.danbay.framework.springnc.annotation.RestController;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * 设备管理服务（注册、登录、登出）
 *
 * @author SJG
 *         2017/10/19
 */
@RestController
@RequestMapping("/device")
public interface IDeviceManageService {

    /**
     * 设备注册
     *
     * @param deviceReg 设备注册信息
     * @throws BusinessException
     */
    @RequestMapping(value = "/register", method = RequestMethod.POST)
    DeviceRegResult register(@RequestBody DeviceReg deviceReg) throws BusinessException;

    /**
     * 设备登录接口
     *
     * @param deviceLogin 登录信息
     * @throws BusinessException
     */
    @RequestMapping("/login")
    void login(@RequestBody DeviceLogin deviceLogin) throws BusinessException;

    /**
     * 设备登出接口
     *
     * @param deviceLogout 登出信息
     * @throws BusinessException
     */
    @RequestMapping("/logout")
    void logout(@RequestBody DeviceLogout deviceLogout) throws BusinessException;

}
